package com.aomiao.orderserver.controller;

import com.aomiao.orderserver.entity.Order;
import com.aomiao.orderserver.feign.MessageFeignClient;
import com.aomiao.orderserver.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author xiah
 * @date 2018/5/11 18:34
 */
@RestController
@RequestMapping("/api/order")
public class OrderController {
       @Autowired
       private OrderService orderService;

       @Autowired
       private MessageFeignClient messageFeignClient;

       @RequestMapping("/getOrderList")
       public Map getOrderList() {
              List list = orderService.getOrderList();
              Map map = new HashMap();
              map.put("list", list);
              map.put("namw", "华盛顿");
              return map;
       }

       @RequestMapping("/addMessage")
       public Long addMessage() {
              return orderService.addMessage();
       }

       @RequestMapping("/testActiveMqp")
       public void testActiveMqp(){
              orderService.testActiveMqp();
       }
}
